package com.pengliu.util;

import com.pengliu.common.exception.ExceptionEnums;


/**
 * user: zhanweichun
 * date: 2017/4/6
 * desc: ajax返回数据
 */
public class AjaxResult {
	private static final int success = 0, fail = -1 ;
    /**
     * 状态
     */
    private Integer code;
    /**
     * 消息
     */
    private String message;
    /**
     * 数据
     */
    private Object data;
    
	public AjaxResult(Integer code,Object data,String message) {
		this.code = code;
		this.data = data;
		this.message = message;
	}
	
    public static AjaxResult getFailResult(String message){
		return new AjaxResult(fail,null,message);
    }
    
    public static AjaxResult getSuccessrResult(Object data){
    	return new AjaxResult(success,data,null);
    }

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}
	
	
}
